<div class='name half_corner <%= stage.pay_status %>'>
  <%= link_to_function "▶#{stage.name}", 
            "work_item_types_by_stage_id('#{stage.id}',this)",
            :class =>  'low base' %>
</div>
<div>
  <div class='crud'>
    <div id="cd_stage_<%= stage.id %>" class='box cud_smart_form'></div>
  </div>
</div>
<div class='tools' id='stage_tools_<%= stage.id %>' style='display:none;'>
  <%= link_to_remote "修改",
        :update => "edit_stage_#{stage.id}",
        :url => edit_stage_url(stage),
        :method => :get,
        :html => {
          :class => :base_i
        }
   %>
  <%= link_to_remote "删除",
        :url => stage_url(stage),
        :method => :delete,
        :html => {
          :class => :base_i
        }
   %>
  <%= link_to_remote '▶分类',
        :update => "cd_stage_#{stage.id}",
        :url => new_work_item_type_stage_url(:stage_id => stage.id),
        :method => :get,
        :loading => "if($('stage_#{stage.id}_work_item_types').style.display == 'none') {Effect.BlindDown('stage_#{stage.id}_work_item_types');}",
        :complete => "Effect.Appear('cd_stage_#{stage.id}_form')",
        :html => {
          :class => :base_i
        }
    %>
  <%= link_to_remote '▶克隆',
        :update => "new_or_edit_project_#{stage.project.id}_stage",
        :url => clone_stage_url(stage),
        :method => :post,
        :complete => "Effect.BlindDown('new_project_#{stage.project.id}_stage')",
        :html => {
          :class => :base_i
        }
    %>
</div>
<div class="stage_info">
  <div class='should_be_pay'><%= t stage.pay_status %>:<b>￥</b><small><%= number_with_precision stage.should_be_payed, :precision => 1 %></small></div>
  <div class='date'>结算期：<b><%= stage.started_on %></b>~<b><%= stage.ended_on %></b></div>
  <% if stage.payed? %>
  <div class="payed_on date ">发放日期：<b><%= stage.payed_on %></b></div>
  <% end %>
</div>